﻿$(document).ready(function () {
    $("#btnUpdateEditorDetails").click(function () {
        var data = $("#divEditorDetails :input").serializeObject();
        data["AlbumSection.AlbumSectionId"] = $("#AlbumSectionId").val();

        var mainDialog = updateDialog("פרטי עורך", "190", "400");

        //Invoke AJAX method to update the album section's editor details
        $.post(pathPrefix + "Albums/UpdateAlbumSectionEditorDetails", data, function (result) {
            mainDialog.html(result.Value);
        }, "json");
    });

    $("#btnSendForApproval").click(function () {
        openConfirmDialog("האם אתה בטוח?", function () {
            var data = {
                "id": $("#AlbumSectionId").val(),
                "statusId": 4
            };

            var mainDialog = updateDialog("אישור מקטע", "190", "400");

            //Invoke AJAX method to change the album section status
            $.post(pathPrefix + "Albums/ChangeAlbumSectionStatus", data, function (result) {
                mainDialog.html(result.Value);
            }, "json");
        });

        return false;
    });
});